<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Message
 *
 * @author ZangGuoPing
 */
class RMessage {

    private static $status;
    private static $errorno;
    private static $msg;
    public static function set($status='true', $msg='', $errorno=0) {
        self::$status = $status;
        self::$errorno = $errorno;
        if(is_array($msg)){
            $error = '';
            foreach ($msg as $key => $value) {
                $error.= $value[0];
            }
            self::$msg = $error;
        }else{
            self::$msg = $msg;
        }
        return CJSON::encode(array('status' => self::$status, 'msg' => $error, 'errorno'=> $errorno));
    }
}

?>
